/*
 * Activator
 */

package ocp.bundles.rfid.impl;


import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.BundleActivator;


/**
 * Activador del bundle
 * @author Paco Lopez Marmol
 */
public class Activator implements BundleActivator {
    
    public static BundleContext bc = null;
    
    private static Rfid rfid = null;

    public void start(BundleContext bc) throws Exception {
        
        Activator.bc = bc;
        
        rfid = new Rfid( "Rfid"  , bc );
        rfid.start();

        System.out.println(bc.getBundle().getHeaders().get( Constants.BUNDLE_NAME) + " comenzado.");
    }

    public void stop(BundleContext bc) throws Exception {
        
        rfid.stop();
        rfid = null;
        
        Activator.bc = null;
        
        System.out.println(bc.getBundle().getHeaders().get( Constants.BUNDLE_NAME) + " terminado.");
    }
   

}
